package cn.yunhe.service;

import cn.yunhe.dao.NewsMapper;
import cn.yunhe.entity.News;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class NewsServices {
    SqlSession sqlSession = SqlSessionFactoryUtil.getSqlSession();

    public List<News> getAllNews() {
        NewsMapper newsMapper = sqlSession.getMapper(NewsMapper.class);
        return newsMapper.getAllNews();
    }


}
